//
//  CateCollectionViewCell.m
//  海角音乐
//
//  Created by dllo on 15/8/18.
//  Copyright (c) 2015年 杨元石. All rights reserved.
//

#import "CateCollectionViewCell.h"

@implementation CateCollectionViewCell


- (id)initWithFrame:(CGRect)frame
{
    
    self = [super initWithFrame:frame];
    
    if (self) {
        
        CGFloat samll_Y = SCREEN_WIDTH*0.08; // 30
        CGFloat samll_width = SCREEN_WIDTH*0.266667; // 100
        
        _small_pic_url = [[UIImageView alloc] initWithFrame:CGRectMake(0, samll_Y, samll_width, samll_width)];
        
        _small_pic_url.layer.masksToBounds = YES;
        _small_pic_url.layer.cornerRadius = samll_width*0.06;
        
        [self.contentView addSubview:_small_pic_url];
        [_small_pic_url release];
        
        
        CGFloat song_Y = SCREEN_WIDTH*0.346666; // 130
        CGFloat song_height = SCREEN_WIDTH*0.053333; // 20
        _songlist_name = [[UILabel alloc] initWithFrame:CGRectMake(0, song_Y, samll_width, song_height)];
        _songlist_name.font = [UIFont systemFontOfSize:14];
        _songlist_name.textColor = [UIColor whiteColor];
        [self.contentView addSubview:_songlist_name];
        [_songlist_name release];
        
    }
    
    return self;
    
    
}

- (void)getModel:(CategoryModel *)cateModel
{
    _songlist_name.text = cateModel.songlist_name;    
    
    [_small_pic_url sd_setImageWithURL:[NSURL URLWithString:cateModel.small_pic_url] placeholderImage:[UIImage imageNamed:@"grid_default.png"]];
    
}

@end
